package com.ztesoft.web.common.customdb.dao;

import javax.annotation.Resource;

import org.mybatis.spring.SqlSessionTemplate;
import org.mybatis.spring.support.SqlSessionDaoSupport;
import org.springframework.stereotype.Repository;

import com.ztesoft.web.baseconfig.db.po.DmStrategyPO;
import com.ztesoft.web.common.customdb.dao.mapper.IDmStrategyCustomMapper;

@Repository
public class DmStrategyCustomDao extends SqlSessionDaoSupport {

	@Resource(name = "majorSqlSessionTemplate")
	public void setSqlSessionTemplate(SqlSessionTemplate sqlSessionTemplate) {
		super.setSqlSessionTemplate(sqlSessionTemplate);
	}
	
	/**
	 * 根据策略ID取seq值最大一条数据
	 * @param strategyId
	 * @return
	 */
	public DmStrategyPO selectTopSeqPOById(Integer strategyId) {
		return getMapper().selectTopSeqPOById(strategyId);
	}

	public IDmStrategyCustomMapper getMapper() {
		return getSqlSession().getMapper(IDmStrategyCustomMapper.class);
	}

}
